/*
 * @Author: ZhongShiGui 13751817115@163.com
 * @Date: 2023-05-06 19:19:05
 * @LastEditors: ZhongShiGui 13751817115@163.com
 * @LastEditTime: 2023-06-06 10:28:58
 * @FilePath: /jxtech-web-starter/src/api/workflow/bean/work-demo.ts
 * @Description: 工作流演示demo
 * 
 * Copyright (c) 2023 by ZhongShiGui, All Rights Reserved. 
 * 2023-05-06 19:19:05
 */

import { OrgServiceApi, WorkflowServiceApi, DemoServiceApi } from "./_workflow";
import { AxiosResponse } from "axios";
import { objectToUrlParams } from "/@/utils/common";
import service from "/@/utils/request";

class JxudpPersonServiceApi extends DemoServiceApi { }
export const ExportJxudpPersonServiceApi = new JxudpPersonServiceApi(
  "/JxudpPersonService"
);

class WorkFlowServiceApi extends WorkflowServiceApi {
  getCorporateElementAuth(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getCorporateElementAuth";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  getWorkflowInfoByBusinessKey(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getWorkflowInfoByBusinessKey";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  getCurrentUserElementAuth(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getCurrentUserElementAuth";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  getCurrentUserIsWithdraw(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getCurrentUserIsWithdraw";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  getWorkflowSettings(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getWorkflowSettings";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  pageHistoryTaskInstanceByInstanceId(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/pageHistoryTaskInstanceByInstanceId";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  getActivityRect(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getActivityRect";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  isStartSelectPerson2(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/isStartSelectPerson2";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  getTaskButtonList(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getTaskButtonList";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  startCorporateWorkFlow(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/startCorporateWorkFlow";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
  getFutureActAuditUsers(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/getFutureActAuditUsers";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
  startWF(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/startWF";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
  completePageAudit(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/completePageAudit";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
  confirmCorporateWorkFlow(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/confirmCorporateWorkFlow";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
}
export const ExportWorkFlowServiceApi = new WorkFlowServiceApi(
  "/WorkFlowService"
);

class WorkFlowTypeServiceApi extends WorkflowServiceApi {
  workFlowTypeId(bean: any, params?: any, WorkFlowTypeUrl?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/id/" + WorkFlowTypeUrl;
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
}
export const ExportWorkFlowTypeService = new WorkFlowTypeServiceApi(
  "/WorkFlowTypeService"
);
class WorkFlowCorporateServiceApi extends WorkflowServiceApi { }
export const ExportWorkFlowCorporateServiceApi = new WorkFlowCorporateServiceApi(
  "/WorkFlowCorporateService"
);
class AuditMessageServiceApi extends WorkflowServiceApi { }
export const ExportAuditMessageServiceApi = new AuditMessageServiceApi(
  "/AuditMessageService"
);
class NextAuditUserServiceApi extends WorkflowServiceApi {
  saveAuditUsers(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/saveAuditUsers";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
}
export const ExportNextAuditUserServiceApi = new NextAuditUserServiceApi(
  "/NextAuditUserService"
);
